use axum::{
    routing::{ delete, get, post },
    Router
};
use com::mdb::gridfs_manage;

pub fn auth_routes() -> Router {
    Router::new()
    .route("/collection/{url}/{db}", get(gridfs_manage::col_list::index))
    // 桶的所有文件
    .route("/gridfs_bucket_list/{id}", get(gridfs_manage::list::index))
    // 删除桶
    .route("/gridfs_bucket_del/{id}", delete(gridfs_manage::del_bucket::index))
    // 删除桶中的单个文件
    .route("/gridfs_file_del", post(gridfs_manage::gridfs_delete::many_auto))
    // 查看单个文件
    // .route("/gridfs_file_find", get(get_gridfs_file))
    .route("/mg_look_by_id_bucket_type",    get(gridfs_manage::gridfs_download_base64::look_by_id_bucket_type))
    .route("/mg_look",    get(gridfs_manage::gridfs_download_base64::look_by_id))
}
